﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace MyWcfRestLib.Files
{
    class CreateFolderOperator : FileOperator
    {
        public CreateFolderOperator(OnePathOpParams theParams)
            : base(theParams)
        {
            CreatingFullPath = Path.Combine(DeviceRootFullPath, theParams.WorkingPath);
        }

        public string CreatingFullPath { get; private set; }
        public bool IsPathExist { get { return UtilityFunctions.PathExists(CreatingFullPath); } }

        public override bool CanPerform
        {
            get { return true; }
        }

        public override bool PerformOperation()
        {
            Directory.CreateDirectory(CreatingFullPath);
            return true;
        }
    }
}
